public class Movie {
//    代码块，另外一种行驶的构造器，是对构造启动补充机制，可以做初始化操作
//    如果多个构造器都有重复语句，可以抽取到代码块中
//    当我们不管调用哪个构造器创建对象时都会先调用代码块
//    以下{}里的就是代码块
{
    System.out.println("电影屏幕打开");
    System.out.println("广告开始。。。");
    System.out.println("电影正式开始。。。");
}
    private String name;
    private double price;
    private String director;
    public Movie(String name){
        this.name=name;
        System.out.println("电影名字:"+this.name);
    }
    public Movie(String name,double price){
        this.name=name;
        this.price=price;
    }
    public Movie(String name,double price,String director){
        this.name=name;
        this.price=price;
        this.director=director;
        System.out.println("三个参数构造器被调用");
    }

    @Override
    public String toString() {
        return "Movie{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", director='" + director + '\'' +
                '}';
    }
}
